import { defHttp } from "@/utils/http";

//流程模型列表
export const modelList = async (params?: any) => {
	return await defHttp.get({ url: "/bpm/model/list", params });
};
//创建流程模型
export const modelCreate = async (params?: any) => {
	return await defHttp.post({ url: "/bpm/model/create", params });
};
//更新流程模型
export const modelUpdate = async (params?: any) => {
	return await defHttp.put({ url: "/bpm/model/update", params });
};
//删除流程模型
export const modelDelete = async (params?: any) => {
	return await defHttp.delete({ url: `/bpm/model/delete?id=${params.id}` });
};
//通过id获取流程信息
export const modelGet = async (params?: any) => {
	return await defHttp.get({ url: `/bpm/model/get`, params });
};
//发布流程
export const modelDeploy = async (params?: any) => {
	return await defHttp.post({ url: `/bpm/model/deploy?id=${params.id}` });
};
//获取流程分类
export const categorySimpleList = async (params?: any) => {
	return await defHttp.get({ url: "/bpm/category/simple-list", params });
};
//获取流程表单
export const formSimpleList = async (params?: any) => {
	return await defHttp.get({ url: "/bpm/form/simple-list", params });
};
//停用流程
export const modelUpdateState = async (params?: any) => {
	return await defHttp.put({ url: "/bpm/model/update-state", params });
};
//获取历史流程
export const processDefinitionPage = async (params?: any) => {
	return await defHttp.get({ url: "/bpm/process-definition/page", params });
};

export const updateModelBpmn = async (data: any) => {
	return await defHttp.put({ url: "/bpm/model/update-bpmn", data: data });
};
